package base.view.widget

import android.app.AlertDialog
import android.content.Context
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.LayoutInflater
import android.widget.Button
import android.widget.ImageView
import base.utils.FocusUtils
import base.utils.SysUtils
import com.tange.ai.iot.client.gnssa.R

/**
 * Created by Administrator on 2018/4/24.
 */
class RefreshDialog(context: Context?) : AlertDialog(context) {

    internal lateinit var refreshBtn: Button
    internal lateinit var backBtn: ImageView
    private lateinit var mContext: Context
    private var listerener: ClickListener? = null

    fun getListerener(): ClickListener? {
        return listerener
    }

    fun setListerener(listerener: ClickListener) {
        this.listerener = listerener
    }


    constructor(listerener: ClickListener, context: Context) : this(context) {
        mContext = context
        this.listerener = listerener
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val view = LayoutInflater.from(mContext).inflate(R.layout.dialog_refresh, null)
        setContentView(view)
        //ButterKnife.bind(this,view);
        getWindow()!!.setBackgroundDrawable(ColorDrawable())
        this.getWindow()!!.setLayout((SysUtils.getScreenWidth(mContext) * 1.0f).toInt(), (SysUtils.getScreenHeight(mContext) * 1.0f).toInt())
    }


    interface ClickListener {
        fun onClick()
    }

}